package org.foreveross.que.application;

import java.util.List;
import java.util.Map;

import org.foreveross.que.entity.MenuEntity;
import org.foreveross.que.infra.base.ddd.Exception.FeedbackException;
import org.foreveross.que.vo.IndexVo;
import org.foreveross.que.vo.TreeChildVo;
import org.foreveross.que.vo.TreeManagerVo;
/**
 * 讨论区操作接口
 * @author lyq
 *
 */
public interface TreeMenuApplication {

//	/**
//	 * 从缓存获取所有菜单
//	 * @return
//	 * @throws Exception 
//	 */
//	public Map<String, TreeChildVo> getMenus(String sysType) throws Exception;
	
	/**
	 * 根据id获取一个实体
	 * @param id
	 * @return
	 * @throws Exception
	 */
	public MenuEntity findEntity(String id) throws Exception;
	/**
	 * 重新加载菜单缓存
	 * @return
	 * @throws FeedbackException 
	 * @throws Exception 
	 */
	public void reloadMenus(String sysType) throws Exception;
	/**
	 * 新增一条记录
	 * @return
	 * @throws Exception
	 */
	public MenuEntity addMenu(TreeManagerVo vo) throws Exception;
	/**
	 * 增加一个系统
	 * @param vo
	 * @return
	 * @throws Exception
	 */
	public TreeChildVo addSys(TreeManagerVo vo) throws Exception;
	
	/**
	 * 修改描述
	 * @param vo
	 * @throws Exception
	 */
	public void updateMenuDesc(IndexVo vo) throws Exception;
	/**
	 * 获取整棵数
	 * @return
	 * @throws Exception
	 */
	@Deprecated
	public List<TreeChildVo> getMenuTree(String sysType) throws Exception;
	
	/**
	 * 获取节点
	 * @return
	 * @throws Exception
	 */
	public TreeChildVo getTreeById(String id,String sysType) throws Exception;
	/**
	 * 加载节点及关联的父节点
	 * 返回结果：list(0)=sysNode ，list(1)=node1,list(1)=node2 ,node2 的父节点是node1
	 * @param treeR
	 * @param mid
	 * @param sysType
	 * @throws Exception
	 */
	public List<TreeChildVo> loadTreeR(String mid,String sysType) throws Exception;
	
	
	/**
	 * 更新
	 * @param vo
	 * @return
	 * @throws Exception
	 */
	public MenuEntity update(TreeManagerVo vo) throws Exception;

	
	/**
	 * 获取所有系统的树
	 * @return
	 * @throws Exception
	 */
	public List<TreeChildVo> getAllMenuTree() throws Exception;
//	/**
//	 * 从角色功能权限中获取有效的树	
//	 * @param mList
//	 * @param sysType
//	 * @return
//	 */
//	@Deprecated
//	public List<TreeChildVo> getTreeByRoleMList(List<String> mList, String sysType) throws Exception;
	
	/**
	 * 封装系统类型树	
	 * @param sysType
	 * @param sysName
	 * @return
	 * @throws Exception
	 */
		public TreeChildVo getSysChildVo(String sysType,String sysName) throws Exception ;
	/**
	 * 自动新增讨论区
	 * @param vo
	 * @return 
	 * @throws Exception
	 */
		public MenuEntity addMenu(IndexVo vo) throws Exception;
}
